#ifndef __RSA_OAEP_H
#define __RSA_OAEP_H

#ifndef IN
#define IN
#endif

#ifdef __cplusplus
extern "C" {
#endif


/*
// Prototype:int RSA_padding_add_PKCS1_OAEP(int hash_alg,
//	unsigned char *to, int tlen,
//	const unsigned char *from, int flen,
//	const unsigned char *label, int lable_len);
// Parameters:
//	hash_alg: Hash alogorithm, could be the following value:
//		HASH_ALG_SHA1: SHA-1;
//		HASH_ALG_SHA256: SHA-256;
//	to: The buffer which is used to store the target data after padding.
//	tlen: The expected length of data after padding.
//	from: Original data.
//	flen: The length of original data.
//	label: Optional label to be associated with the message; if not provided, is the empty string.
//	label_len: The length of label, if not provided, should be set to 0.
// return:
//	1: Succeed;
//	0: Fail;
// remarks: This function is used to pad the original data according to PKCS#1 OAEP rules.
*/
int RSA_padding_add_PKCS1_OAEP(int hash_alg,
	unsigned char *to, int tlen,
	const unsigned char *from, int flen,
	const unsigned char *label, int lable_len);

/*
// int RSA_padding_check_PKCS1_OAEP(int hash_alg, unsigned char *to, int tlen,
//	IN unsigned char *from, int flen, int num,
//	IN unsigned char *param, int plen);
// Parameters:
//	hash_alg: Hash alogorithm, could be the following value:
//		HASH_ALG_SHA1: SHA-1;
//		HASH_ALG_SHA256: SHA-256;
//	to: The buffer which is used to store the original data after decoding.
//	tlen: The buffer length of "to".
//	from: The data buffer for decoding.
//	flen: The buffer length of "from".
//	num: The length of RSA modulus.
//	param: Optional label to be associated with the message; if not provided, is the empty string.
//	plen: The length of label, if not provided, should be set to 0.
// return:
//	>0: Succeed, return the length of original data (before padding).
//	Other values: Fail;
// remarks: This function is used to check the format of PKCS #1 OAEP padding.
*/
int RSA_padding_check_PKCS1_OAEP(int hash_alg, unsigned char *to, int tlen,
	unsigned char *from, int flen, int num,
	unsigned char *param, int plen);

#ifdef __cplusplus
}
#endif

#endif // __RSA_OAEP_H
